package com.hnjd.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.hnjd.entity.Goods;
import com.hnjd.util.PageUtil;

public interface GoodsMapper {

	
	
	public List<Goods> findAllGoods(@Param("page")PageUtil page,@Param("type")Integer type);
	
	@Delete("delete from goods where id=#{id}")
	public void goodDelete(Integer id);
	
	
	public Goods findGoodById(Integer id);
	
	
	@Update("update goods set cover=#{cover},name=#{name} ,intro=#{intro},spec=#{spec},price=#{price},stock=#{stock},content=#{content},type_id=#{typeId} where goods.id=#{id}")
	public void updateGoods(Goods good);


	
    @Insert("insert into goods values(null,#{cover},#{name},#{intro},#{spec},#{price},#{stock},#{sales},#{content},#{type.id})")
	public void goodAdd(Goods good);


    
    
}
